/*
 * Copyright 1999-2004 Alibaba.com All right reserved. This software is the confidential and proprietary information of
 * Alibaba.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the license agreement you entered into with Alibaba.com.
 */
package com.liangdev.biz.service.common.impl;

import java.util.List;

import com.liangdev.biz.dataobject.common.SysConfigDO;
import com.liangdev.biz.query.common.SysConfigQuery;
import com.liangdev.biz.service.common.SysConfigService;
import com.liangdev.common.base.service.impl.GenericServiceImpl;

/**
 * 类DomainDeletedServiceImpl.java的实现描述：TODO 类实现描述
 * 
 * @author chongan.wangca 2012-4-19 上午12:04:18
 */
public class SysConfigServiceImpl extends GenericServiceImpl<SysConfigDO, SysConfigQuery> implements SysConfigService {

    /*
     * (non-Javadoc)
     * @see com.jinmibao.biz.service.common.SysConfigService#findByGroupName(java.lang.String)
     */
    @Override
    public List<SysConfigDO> findByGroupName(String groupName) {
        SysConfigQuery sysConfigQuery = new SysConfigQuery();
        sysConfigQuery.setGroupName(groupName);
        return findList(sysConfigQuery);
    }

    /*
     * (non-Javadoc)
     * @see com.jinmibao.biz.service.common.SysConfigService#updateValueById(java.lang.Long, java.lang.String)
     */
    @Override
    public boolean updateValueById(Long id, String value) {
        SysConfigDO sysConfigDO = new SysConfigDO();
        sysConfigDO.setId(id);
        sysConfigDO.setValue(value);
        return update(sysConfigDO);
    }

    /*
     * (non-Javadoc)
     * @see com.jinmibao.biz.service.common.SysConfigService#updateValueByGroupNameAndName(java.lang.String,
     * java.lang.String, java.lang.String)
     */
    @Override
    public boolean updateValueByGroupNameAndName(String groupName, String name, String value) {
        SysConfigQuery sysConfigQuery = new SysConfigQuery();
        sysConfigQuery.setGroupName(groupName);
        sysConfigQuery.setName(name);
        SysConfigDO sysConfigDO = find(sysConfigQuery);
        sysConfigDO.setValue(value);
        return update(sysConfigDO);
    }

}
